home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #2 / Amiga Plus CD - 1995 - No. 2.iso / pd / disktools / diskspare / support / programmers.doc < prev    next >
Text File  |  1995-04-11  |  7KB  |  234 lines

  1.  
  2. *****************************************************************
  3. *                                *
  4. *    NOTE:   IF YOU USE THE DISKSPARE.DEVICE FOR YOUR    *
  5. *    PROGRAMS YOU HAVE TO COPY THIS DOC.FILE TOO !!!!    *
  6. *                                *
  7. *    Note:                                        *
  8. *    I can only support your program in future releases    *
  9. *    of the device, if you send me a FREE copy.        *
  10. *                                *
  11. *****************************************************************
  12.  
  13. TABLE OF CONTENTS
  14.  
  15. diskspare.device/CMD_Remove
  16. diskspare.device/CMD_GetGeometry
  17. diskspare.device/CMD_RawRead
  18. diskspare.device/CMD_RawWrite
  19. diskspare.device/CMD_Eject
  20. diskspare.device/Open
  21.  
  22. The other commands work like the corresponding trackdisk cmds.
  23.  
  24. KNOWN BUGS:    * The value of dg_CylSectors returned by GetGeoMetry
  25.           is wrong.
  26.           Fixed in V2.0.
  27.         * The Device doesn't support ETD_Cmds correctly.
  28.           Fixed in V2.1.
  29.         * The Device returns an Error IOERR_BADADDRESS
  30.           if the adress of IO_DATA is odd (PFS only).
  31.           Fixed in V2.1.
  32.         * If remove is called twice, the System crashes.
  33.           Fixed in V2.1.
  34.         * Error in CloseDevice: Maybe a RemPort on a Port 
  35.           which wasn't added -> Crash (caused by register mistake)
  36.           Fixed in V2.1
  37.         * Error in TD_FORMAT: Doesn't do an Update but flushes
  38.           the trackbuffer. (PFS only)
  39.           Fixed in V2.2
  40.         * It was possible to read/write beyond the last track.
  41.           Fixed in V3.0
  42.         * Error in CMD_READ: Trackbuffer not cleared although disk
  43.           changed. (PFS only)
  44.           Fixed in V3.0
  45.         * Enforcer hit in initport.
  46.           Fixed in V3.0
  47.  
  48. NAME        Remove
  49.  
  50. FUNCTION    If you are not the FastFileSystem, and I guess 
  51.         you aren't, NEVER call Remove ! 
  52.         It's no use calling Remove !!
  53.         The best thing is to forget that there's a 
  54.         cmd called Remove !!! 
  55.         IF you call this forgotten cmd and the DD<>HD
  56.         autoswitch is enabled (Bit 2 in Flags is set), the 
  57.         system WILL crash !!!!
  58.         If you want to add a diskchange-int, use the
  59.         addchangeint/remchangeint cmd instead.
  60.         
  61.         Why was this patch necessary ?
  62.         Because there's a restriction in the FFS: It checks, 
  63.         if the devicename is 'trackdisk.device' and if it 
  64.         isn't, GetGeometry won't be called.
  65.         
  66.         I tried to fix the disksize in the dosenvec-struct
  67.         and all programs like FixDisk, DiskSalv, Format etc 
  68.         worked fine. BUT the FFS said 'Not a DOS Disk'...
  69.         
  70. SEE ALSO    Includes/exec/alerts.i
  71.  
  72. BUGS        If Remove was called twice, the System crashed.
  73.         Fixed in V2.1.
  74.  
  75. NAME        GetGeometry
  76.  
  77. FUNCTION    Works like trackdisk.
  78.         There are two possibilities for Sectors per Track:
  79.         12 sectors/track and 24 sectors/track.
  80.         You have to check this after each diskchange !
  81.         New for V3.0:
  82.         You get always the right disksize. 
  83.         The HD mode always works (with HD drives). 
  84.         Please check version number.
  85.                 
  86. SEE ALSO    AutoDocs/trackdisk.doc
  87.  
  88. BUGS        There was a bug in the first release (V1.6):
  89.         The value returned in dg_CylSectors was wrong.
  90.         I forgot an 'ext.l', so the contents of the 
  91.         high order word was rubbish. Fixed in V2.0.
  92.         
  93.  
  94.         
  95. NAME        RawRead
  96.  
  97. FUNCTION    No Function ! Returns IOERR_NOCMD. Use trackdisk
  98.         device for rawread.
  99.  
  100.         
  101.         
  102. NAME        RawWrite
  103.  
  104. FUNCTION    No Function ! Returns IOERR_NOCMD. Use trackdisk
  105.         device for rawwrite.
  106.         
  107.         
  108.         
  109. NAME        Eject
  110.  
  111. FUNCTION    No Function ! Returns IOERR_NOCMD. Use trackdisk
  112.         device to eject (if you've got a drive which ejects).
  113.         
  114.         
  115.         
  116. NAME        OpenDevice
  117.  
  118. FUNCTION    Opens the device with a drive-specific set of flags.
  119.         There's something special about the flags:
  120.         
  121.         If the device wasn't opened yet, everything works as
  122.         usual. If the device was already opened (via Mount)
  123.         your flags will be ignored, but the device won't 
  124.         return an error. (Some well known programs crash
  125.         when an OPENFAIL was returned ??? They obviously
  126.         don't use the fssm_Flags when opening AND don't 
  127.         check for errors ?¿?)
  128.         
  129.         The active flags are returned in IO_ACTUAL. So you 
  130.         can check whether the flags fit your needs or not.        
  131.         
  132.         Why ?
  133.         If the user has mounted the device with HighCyl = 79
  134.         then it's his decision not to use it and you HAVE TO 
  135.         accept that. It's the users Amiga not yours. 
  136.  
  137.         The minimum you get is:
  138.         
  139.         heads:              2
  140.         tracks:            160
  141.         sectors/track:       12/24
  142.         bytes/sector:        512        
  143.         
  144.         # of sectors:           1920/3840
  145.         total bytes:         983040/1966080
  146.  
  147.  
  148. SEE ALSO    AutoDocs/exec.doc/opendevice
  149.          
  150.  
  151. FLAGS
  152.         BIT    0    0: disable diskchange for DFX:
  153.                 1: enable diskchange for DFX:
  154.         Works only when mounting the device with the FastFileSystem.
  155.         When you open the device and don't call the forgotten
  156.         cmd the diskchange-int of the corresponding trackdisk
  157.         drive won't be affected.
  158.         
  159.         BIT    1    0: HighCyl is Cyl. 79
  160.                 1: HighCyl is Cyl. 81
  161.         When set to '1' trackdisk WILL be patched everytime a
  162.         track is read/written from/to disk!
  163.         
  164.         BIT    2    0: DD and HD mode are now available.
  165.                    That's new. Check the device version.
  166.                 1: Autodetection of DD/HD-disks for the
  167.                    FastFileSystem, too. It is patched.
  168.         Call GetGeometry to get the right disksize. See above.
  169.         The patch for the ffs is in the remove cmd. So if you
  170.         open without bit 1 set and don't call the forgotten cmd
  171.         NOTHING is patched !!
  172.                 
  173.         Version 2.2:
  174.         BIT    3    0: Use any Mem for trackbuffer
  175.                 1: Try to use Mem from $600000 - $A00000
  176.                    If there's no memory at this location
  177.                    any other mem is used.
  178.         Why ? I've got an A2000 with A2630 (which has it's mem at
  179.         $200000-$5FFFFF) and a 16bit Ramcard at $600000 - $A00000.
  180.         So why should I use the 32bit ram (which is prefered when
  181.         calling allocmem) for a trackbuffer ?
  182.         This bit may be useful for A3/4000 with 16bit ramboards too.
  183.         Version 3.0:
  184.         BIT    3    isn't used.
  185.         
  186.         Version 3.0:
  187.         BIT    4    0: Normal write mode.
  188.                 1: Verify write mode. Each write will be
  189.                    verfied by the device itself. This nearly
  190.                    half the write speed but you're sure the
  191.                    data on disk is ok. Useful with cheap
  192.                    disks.                 
  193.     
  194.         BIT    5-31    are currently unused and RESERVED.                
  195.  
  196.  
  197. NOTES        
  198.  
  199.     HD-Mode:
  200.     To check if the drive is a highdensity one you may call
  201.     GetUnitID from the disk.resource. Here are the Results:
  202.         
  203.     No Disk in any Drive    ->    returns 0x00000000
  204.     Any Disk in a DD Drive    ->    returns 0x00000000
  205.     A DD-Disk in a HD Drive ->    returns 0x00000000
  206.     A HD-Disk in a HD Drive    ->    returns 0xAAAAAAAA
  207.     No Drive connected    ->    returns 0xFFFFFFFF
  208.         
  209.     As you can see, it's not possible to check if the drive
  210.     is a hd one, if there's no HD Disk in it.
  211.     Don't care about that. Simply call GetGeometry to get the
  212.     right disksize. BUT it may be differently for each disk (DD/HD).
  213.  
  214.         AddChangeInt:
  215.         If you've already added a ChangeInt with the trackdisk.device,
  216.         you needn't add one with diskspare.device because it's directly 
  217.         passed through to the trackdisk.device.
  218.  
  219.     Inhibit:
  220.     It's a good idea to inhibit the corresponding trackdisk drive
  221.     (DFX) when accessing the disk via diskspare.device. Also
  222.     check for mounted diskspare drives. Don't rely on the names 
  223.     DS0: to DS3: when you inhibit the DOS. 
  224.     The device itself can't inhibit the DOS because a task isn't 
  225.     allowed to call a dos.lib function.
  226.     
  227.     
  228.     General:
  229.     The main purpose of this device is to be mounted with the
  230.     FastFileSystem. So always remember that you may not be the 
  231.     only accessor !!
  232.         
  233.     
  234.